import request from '@/config/axios'

// 基础设置 VO
export interface BasicSettingVO {
  id: number // ID
  settingName: string // 配置项
  settingContent: string // 配置项内容
}

// 基础设置 API
export const BasicSettingApi = {
  // 查询基础设置分页
  getBasicSettingPage: async (params: any) => {
    return await request.get({ url: `/promotion/basic-setting/page`, params })
  },

  // 查询基础设置详情
  getBasicSetting: async (id: number) => {
    return await request.get({ url: `/promotion/basic-setting/get?id=` + id })
  },

  // 新增基础设置
  createBasicSetting: async (data: BasicSettingVO) => {
    return await request.post({ url: `/promotion/basic-setting/create`, data })
  },

  // 修改基础设置
  updateBasicSetting: async (data: BasicSettingVO) => {
    return await request.put({ url: `/promotion/basic-setting/update`, data })
  },

  // 删除基础设置
  deleteBasicSetting: async (id: number) => {
    return await request.delete({ url: `/promotion/basic-setting/delete?id=` + id })
  },

  // 导出基础设置 Excel
  exportBasicSetting: async (params) => {
    return await request.download({ url: `/promotion/basic-setting/export-excel`, params })
  },
}
